#ifndef UI_TASK_H_
#define UI_TASK_H_
#include <gtk/gtk.h>
#include "common.h"
#include "http_manager.h"

enum{
    COLUMN_FILENAME,
    COLUMN_SIZE,
    COLUMN_PROGRESS,
    COLUMN_STATUS,
    COLUMN_ESTIMATE_TIME,
    COLUMN_TRANSFER_RATE,
    COLUMN_CREATE_TIME,
    N_COLUMNS
};

enum{
    STATUS_READY,
    STATUS_DOWNLOADING,
    STATUS_FINISHED,
    STATUS_FAILED,
    STATUS_CANCELED,
    N_STATUS
};

int ShowConfirmInfo(GtkWidget *widget, gpointer userdata);
void ShowErrorInfo(GtkWidget *widget, gpointer userdata);

void InitTaskList(GtkBuilder *builder);
GtkBuilder *OpenUiFile(char *ui_file, GObject **ui_window, int isdestroy);
void FreeTaskList(void);

void OpenNewTaskWindow(GtkWidget *widget, gpointer userdata);
void StartDownladTask(GtkWidget *widget, gpointer userdata);
void RemoveSlectedTask(GtkWidget *widget, gpointer userdata);
void StopDownloadingTask(GtkWidget *widget, gpointer userdata);

int updateProcess(HttpContext *context);
#endif